import java.util.Scanner;

// Point 类（题目已给出）
class Point {
    private int x, y; // x,y为点的坐标

    // 求两点之间的距离
    public double distance(Point p1) {
        return Math.sqrt((p1.x - this.x) * (p1.x - this.x) + (p1.y - this.y) * (p1.y - this.y));
    }

    public Point(int x, int y) {
        super();
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public Point() {
        super();
        x = y = 0;
    }

    @Override
    public String toString() {
        return "Point [x=" + x + ", y=" + y + "]";
    }
}

// Line 类
class Line {
    private Point p1, p2;

    // 有参构造方法
    public Line(Point p1, Point p2) {
        this.p1 = p1;
        this.p2 = p2;
    }

    // p1 的 getter 和 setter
    public Point getP1() {
        return p1;
    }

    public void setP1(Point p1) {
        this.p1 = p1;
    }

    // p2 的 getter 和 setter
    public Point getP2() {
        return p2;
    }

    public void setP2(Point p2) {
        this.p2 = p2;
    }

    // 计算两点之间的距离
    public double getLength() {
        return p1.distance(p2);
    }

    // 重写 toString 方法
    @Override
    public String toString() {
        return "Line [p1=" + p1 + ", p2=" + p2 + "]";
    }
}

// Main 类
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        // 输入数组的长度
        int n = scanner.nextInt();
        Line[] lines = new Line[n];

        // 为每条线段输入两个点的坐标
        for (int i = 0; i < n; i++) {
            int x1 = scanner.nextInt();
            int y1 = scanner.nextInt();
            int x2 = scanner.nextInt();
            int y2 = scanner.nextInt();

            // 创建两个 Point 对象
            Point p1 = new Point(x1, y1);
            Point p2 = new Point(x2, y2);

            // 创建 Line 对象并放入数组
            lines[i] = new Line(p1, p2);
        }

        // 输出每条直线的信息和长度
        for (Line line : lines) {
            System.out.println(line);
            System.out.printf("此线段的长度为：%.1f\n", line.getLength());
        }

        scanner.close();
    }
}